{% extends "base.html" %}

{% block title %}

{% endblock %}

{% block body %}
<form method="POST" enctype="multipart/form-data">
  <label for="title">Contest title:</label><br>
  <input type="text" name="contest_title" id="title" size="80" value="{{contest.name}}">
  <p>
    Contest description:<br>
    <textarea name="contest_description" rows="6" cols="62">{{contest.description}}</textarea>
  <p>
    <label for="name">Contest owner:</label>
    <input type="name" name="name" id="name" value="{{contest.creator}}">

  {% if contest.image %}
  <img src="/contestimage/{{contest.image.key.id}}" class="thumbnailImage"/>
  {% else %}
  <p>
    <label for="photo_url">Image url:</label>
    <input type="text" name="photo_url" id="photo_url">
    or
    <label for="contest_image">Image file:</label>
    <input type="file" name="contest_image" id="contest_image">
  {% endif %}

  <p>
    <label for="contest_start_time">Start time:</label>
    <input type="text" name="contest_start_time" id="contest_start_time" value="{{ contest.start_time|FormatDateForInput }}">
  <p>
    <label for="contest_end_time">End time:</label>
    <input type="text" name="contest_end_time" id="contest_end_time" value="{{ contest.end_time|FormatDateForInput }}">
  <p>
    <label for="disabled">Disabled:</label>
    <input type="checkbox" name="disabled" id="disabled" value="disabled" {{contest.disabled|yesno:"checked,"}}>
  <p>
    <label for="photo_credit">Photo credit (blank is ok):</label>
    <input type="text" name="photo_credit" id="photo_credit" value="{{contest.photo_credit}}">
  <p>
    <input type="submit">
</form>
{% endblock %}
